package cn.edu.scau.sec.zhangsan.adapter;

import java.util.Calendar;

public class ClassAdapter extends Adaptee implements Target {

	@Override
	public void printDate(String calendarString) {
		// 将calendarString转换为Calendar类型
		Calendar calendar = Calendar.getInstance();

		String[] calendarStrings = calendarString.split("\\.");

		calendar.set(Integer.parseInt(calendarStrings[0]), Integer.parseInt(calendarStrings[1]) - 1,
				Integer.parseInt(calendarStrings[2]));

		System.out.println("类适配器：");
		printCalendar(calendar);
	}
}